package com.example.demo.leakybucket;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/leaky/bucket")
public class LeakyBucketController {
    private Integer count = 0;

    @RequireLeaky
    @SneakyThrows
    @GetMapping("/flow/control")
    public String control() {
        log.info("执行成功{}", count);
        return "执行成功" + count++;
    }
}
